/*******************************************************************************
 *   LPC288x.h:  Header file for Philips LPC288x Family Microprocessors
 *   The header file is the super set of all hardware definition of the 
 *   peripherals for the LPC288x family microprocessor.
 *
 *   Copyright(C) 2006, Philips Semiconductor
 *   All rights reserved.
 *
 *   Current revision
 *   2007.01.09  ver 1.2 
 *
 *   Note: There are 17 unnamed register locations in the Clock Generation 
 *         Unit,which are designated as X1-X17. These 17 locations should 
 *         be initialized to zero to minimize total power consumption
 *
 *	 Revision History: 
 *			v1.0- First release(2006.08.15) 
 *				- The main PLL and high speed PLL register locations were incorrect
 *			v1.1- Second release 
 *				- EMCMisc, DMA3EXTEN, DMA5EXTEN had incorrect register locations
***********************************************************************************/
#ifndef __LPC288x_H
#define __LPC288x_H

/* System Control */
#define SYS_BOOTMAP		(*((volatile unsigned int *) 0x80005070))
#define SYS_BOOTADDR	(*((volatile unsigned int *) 0x80005074))

/* Cache/ Memory Map */
#define CACHE_RST_STAT   (*((volatile unsigned int *) 0x80104000))
#define CACHE_SETTINGS   (*((volatile unsigned int *) 0x80104004))
#define CACHE_PAGE_CTRL  (*((volatile unsigned int *) 0x80104008))
#define C_RD_MISSES		 (*((volatile unsigned int *) 0x8010400C))
#define C_FLUSHES		 (*((volatile unsigned int *) 0x80104010))
#define C_WR_MISSES		 (*((volatile unsigned int *) 0x80104014))
#define ADDRESS_PAGE_0   (*((volatile unsigned int *) 0x80104018))
#define ADDRESS_PAGE_1   (*((volatile unsigned int *) 0x8010401C))
#define ADDRESS_PAGE_2   (*((volatile unsigned int *) 0x80104020))
#define ADDRESS_PAGE_3   (*((volatile unsigned int *) 0x80104024))
#define ADDRESS_PAGE_4   (*((volatile unsigned int *) 0x80104028))
#define ADDRESS_PAGE_5   (*((volatile unsigned int *) 0x8010402C))
#define ADDRESS_PAGE_6   (*((volatile unsigned int *) 0x80104030))
#define ADDRESS_PAGE_7   (*((volatile unsigned int *) 0x80104034))
#define ADDRESS_PAGE_8   (*((volatile unsigned int *) 0x80104038))
#define ADDRESS_PAGE_9   (*((volatile unsigned int *) 0x8010403C))
#define ADDRESS_PAGE_10  (*((volatile unsigned int *) 0x80104040))
#define ADDRESS_PAGE_11  (*((volatile unsigned int *) 0x80104044))
#define ADDRESS_PAGE_12  (*((volatile unsigned int *) 0x80104048))
#define ADDRESS_PAGE_13  (*((volatile unsigned int *) 0x8010404C))
#define ADDRESS_PAGE_14  (*((volatile unsigned int *) 0x80104050))
#define ADDRESS_PAGE_15  (*((volatile unsigned int *) 0x80104054))
#define CPU_CLK_GATE	 (*((volatile unsigned int *) 0x80104058))

/* Flash Memory Controller */
#define F_CTRL	 	 (*((volatile unsigned int *) 0x80102000))
#define F_STAT		 (*((volatile unsigned int *) 0x80102004))
#define F_PROG_TIME	 (*((volatile unsigned int *) 0x80102008))
#define F_WAIT	 	 (*((volatile unsigned int *) 0x80102010))
#define F_CLK_TIME	 (*((volatile unsigned int *) 0x8010201C))
#define F_INTEN_CLR	 (*((volatile unsigned int *) 0x80102FD8))
#define F_INTEN_SET	 (*((volatile unsigned int *) 0x80102FDC))
#define F_INT_STAT	 (*((volatile unsigned int *) 0x80102FE0))
#define F_INTEN	 	 (*((volatile unsigned int *) 0x80102FE4))
#define F_INT_CLR	 (*((volatile unsigned int *) 0x80102FE8))
#define F_INT_SET	 (*((volatile unsigned int *) 0x80102FEC))
#define FLASH_PD	 (*((volatile unsigned int *) 0x80005030))
#define FLASH_INIT	 (*((volatile unsigned int *) 0x80005034))

/* DC-DC Converter */
#define DCDCADJUST1	 (*((volatile unsigned int *) 0x80005004))
#define DCDCADJUST2	 (*((volatile unsigned int *) 0x80005008))
#define DCDCCLKSEL   (*((volatile unsigned int *) 0x8000500C))

/* ------- Clock Generation Unit ------- */

/* CGU Configuration */
#define PMODE   	(*((volatile unsigned int *) 0x80004C00))
#define WDBARK  	(*((volatile unsigned int *) 0x80004C04))
#define OSC32EN     (*((volatile unsigned int *) 0x80004C08))
#define OSCEN	    (*((volatile unsigned int *) 0x80004C10))

/* Main PLL */
#define LPFIN 	  	  (*((volatile unsigned int *) 0x80004CE4))
#define LPPDN		  (*((volatile unsigned int *) 0x80004CE8))
#define LPBYPASS	  (*((volatile unsigned int *) 0x80004CEC))
#define LPLOCK		  (*((volatile unsigned int *) 0x80004CF0))
#define LPDIRECT	  (*((volatile unsigned int *) 0x80004CF4))
#define LPMSEL		  (*((volatile unsigned int *) 0x80004CF8))
#define LPPSEL		  (*((volatile unsigned int *) 0x80004CFC))

/* High Speed PLL */
#define HPFIN 	  	  (*((volatile unsigned int *) 0x80004CAC))
#define HPNDEC 	  	  (*((volatile unsigned int *) 0x80004CB4))
#define HPMDEC 	  	  (*((volatile unsigned int *) 0x80004CB0))
#define HPPDEC	  	  (*((volatile unsigned int *) 0x80004CB8))
#define HPMODE 	  	  (*((volatile unsigned int *) 0x80004CBC))
#define HPSTAT	  	  (*((volatile unsigned int *) 0x80004CC0))
#define HPREQ 	  	  (*((volatile unsigned int *) 0x80004CC8))
#define HPACK 	  	  (*((volatile unsigned int *) 0x80004CC4))
#define HPSELR	  	  (*((volatile unsigned int *) 0x80004CD8))
#define HPSELI 	  	  (*((volatile unsigned int *) 0x80004CDC))
#define HPSELP	  	  (*((volatile unsigned int *) 0x80004CE0))

/* Selection Stage */
#define SYSSCR 	  	  (*((volatile unsigned int *) 0x80004000))
#define APB0SCR 	  (*((volatile unsigned int *) 0x80004004))
#define APB1SCR	  	  (*((volatile unsigned int *) 0x80004008))
#define APB3SCR	  	  (*((volatile unsigned int *) 0x8000400C))
#define DCDCSCR	  	  (*((volatile unsigned int *) 0x80004010))
#define RTCSCR 	  	  (*((volatile unsigned int *) 0x80004014))
#define MCISCR 	  	  (*((volatile unsigned int *) 0x80004018))
#define UARTSCR	  	  (*((volatile unsigned int *) 0x8000401C))
#define DAIOSCR   	  (*((volatile unsigned int *) 0x80004020))
#define DAISCR 	  	  (*((volatile unsigned int *) 0x80004024))

#define SYSFSR1   	  (*((volatile unsigned int *) 0x8000402C))
#define APB0FSR1 	  (*((volatile unsigned int *) 0x80004030))
#define APB1FSR1  	  (*((volatile unsigned int *) 0x80004034))
#define APB3FSR1  	  (*((volatile unsigned int *) 0x80004038))
#define DCDCFSR1  	  (*((volatile unsigned int *) 0x8000403C))
#define RTCFSR1	 	  (*((volatile unsigned int *) 0x80004040))
#define MCIFSR1   	  (*((volatile unsigned int *) 0x80004044))
#define UARTFSR1  	  (*((volatile unsigned int *) 0x80004048))
#define DAIOFSR1   	  (*((volatile unsigned int *) 0x8000404C))
#define DAIFSR1	  	  (*((volatile unsigned int *) 0x80004050))

#define SYSFSR2   	  (*((volatile unsigned int *) 0x80004058))
#define APB0FSR2 	  (*((volatile unsigned int *) 0x8000405C))
#define APB1FSR2  	  (*((volatile unsigned int *) 0x80004060))
#define APB3FSR2  	  (*((volatile unsigned int *) 0x80004064))
#define DCDCFSR2  	  (*((volatile unsigned int *) 0x80004068))
#define RTCFSR2	 	  (*((volatile unsigned int *) 0x8000406C))
#define MCIFSR2   	  (*((volatile unsigned int *) 0x80004070))
#define UARTFSR2  	  (*((volatile unsigned int *) 0x80004074))
#define DAIOFSR2   	  (*((volatile unsigned int *) 0x80004078))
#define DAIFSR2	  	  (*((volatile unsigned int *) 0x8000407C))

#define SYSSSR   	  (*((volatile unsigned int *) 0x80004084))
#define APB0SSR 	  (*((volatile unsigned int *) 0x80004088))
#define APB1SSR  	  (*((volatile unsigned int *) 0x8000408C))
#define APB3SSR  	  (*((volatile unsigned int *) 0x80004090))
#define DCDCSSR  	  (*((volatile unsigned int *) 0x80004094))
#define RTCSSR	 	  (*((volatile unsigned int *) 0x80004098))
#define MCISSR   	  (*((volatile unsigned int *) 0x8000409C))
#define UARTSSR  	  (*((volatile unsigned int *) 0x800040A0))
#define DAIOSSR   	  (*((volatile unsigned int *) 0x800040A4))
#define DAISSR	  	  (*((volatile unsigned int *) 0x800040A8))

#define SYSBCR   	  (*((volatile unsigned int *) 0x800043F0))
#define APB0BCR 	  (*((volatile unsigned int *) 0x800043F4))
#define DAIOBCR	  	  (*((volatile unsigned int *) 0x800043F8))

/* Fractional Divider */
#define SYSFDCR0   	  (*((volatile unsigned int *) 0x800043FC))
#define SYSFDCR1   	  (*((volatile unsigned int *) 0x80004400))
#define SYSFDCR2   	  (*((volatile unsigned int *) 0x80004404))
#define SYSFDCR3   	  (*((volatile unsigned int *) 0x80004408))
#define SYSFDCR4   	  (*((volatile unsigned int *) 0x8000440C))
#define SYSFDCR5   	  (*((volatile unsigned int *) 0x80004410))
#define APB0FDCR0  	  (*((volatile unsigned int *) 0x80004414))
#define APB0FDCR1  	  (*((volatile unsigned int *) 0x80004418))
#define APB1FDCR  	  (*((volatile unsigned int *) 0x8000441C))
#define APB3FDCR  	  (*((volatile unsigned int *) 0x80004420))
#define UARTFDCR  	  (*((volatile unsigned int *) 0x80004424))
#define DAIOFDCR0  	  (*((volatile unsigned int *) 0x80004428))
#define DAIOFDCR1  	  (*((volatile unsigned int *) 0x8000442C))
#define DAIOFDCR2  	  (*((volatile unsigned int *) 0x80004430))
#define DAIOFDCR3  	  (*((volatile unsigned int *) 0x80004434))
#define DAIOFDCR4  	  (*((volatile unsigned int *) 0x80004438))
#define DAIOFDCR5  	  (*((volatile unsigned int *) 0x8000443C))

/* Power Control */
#define APB0PCR0   	  (*((volatile unsigned int *) 0x800040B0))
#define APB1PCR0   	  (*((volatile unsigned int *) 0x800040B4))
#define APB2PCR0   	  (*((volatile unsigned int *) 0x800040B8))
#define APB3PCR0   	  (*((volatile unsigned int *) 0x800040BC))
#define MMIOPCR0   	  (*((volatile unsigned int *) 0x800040C0))
#define AHB0PCR   	  (*((volatile unsigned int *) 0x800040C4))
#define MCIPCR0   	  (*((volatile unsigned int *) 0x800040C8))
#define MCIPCR1   	  (*((volatile unsigned int *) 0x800040CC))
#define UARTPCR0   	  (*((volatile unsigned int *) 0x800040D0))
#define DSSPCR0   	  (*((volatile unsigned int *) 0x800040D4))
#define X1		   	  (*((volatile unsigned int *) 0x800040D8))
#define FLSHPCR0   	  (*((volatile unsigned int *) 0x800040DC))
#define FLSHPCR1   	  (*((volatile unsigned int *) 0x800040E0))
#define FLSHPCR2   	  (*((volatile unsigned int *) 0x800040E4))
#define LCDPCR0   	  (*((volatile unsigned int *) 0x800040E8))
#define LCDPCR1   	  (*((volatile unsigned int *) 0x800040EC))
#define DMAPCR0   	  (*((volatile unsigned int *) 0x800040F0))
#define DMAPCR1   	  (*((volatile unsigned int *) 0x800040F4))
#define USBPCR0   	  (*((volatile unsigned int *) 0x800040F8))
#define CPUPCR0   	  (*((volatile unsigned int *) 0x800040FC))
#define CPUPCR1   	  (*((volatile unsigned int *) 0x80004100))
#define CPUPCR2   	  (*((volatile unsigned int *) 0x80004104))
#define RAMPCR   	  (*((volatile unsigned int *) 0x80004108))
#define ROMPCR   	  (*((volatile unsigned int *) 0x8000410C))
#define EMCPCR0   	  (*((volatile unsigned int *) 0x80004110))
#define EMCPCR1   	  (*((volatile unsigned int *) 0x80004114))
#define MMIOPCR1   	  (*((volatile unsigned int *) 0x80004118))
#define APB0PCR1   	  (*((volatile unsigned int *) 0x8000411C))
#define EVRTPCR   	  (*((volatile unsigned int *) 0x80004120))
#define RTCPCR0   	  (*((volatile unsigned int *) 0x80004124))
#define ADCPCR0   	  (*((volatile unsigned int *) 0x80004128))
#define ADCPCR1   	  (*((volatile unsigned int *) 0x8000412C))
#define WDTPCR   	  (*((volatile unsigned int *) 0x80004130))
#define IOCPCR   	  (*((volatile unsigned int *) 0x80004134))
#define CGUPCR   	  (*((volatile unsigned int *) 0x80004138))
#define SYSCPCR   	  (*((volatile unsigned int *) 0x8000413C))
#define APB1PCR1   	  (*((volatile unsigned int *) 0x80004140))
#define T0PCR   	  (*((volatile unsigned int *) 0x80004144))
#define T1PCR   	  (*((volatile unsigned int *) 0x80004148))
#define I2CPCR   	  (*((volatile unsigned int *) 0x8000414C))
#define APB3PCR1   	  (*((volatile unsigned int *) 0x80004150))
#define SCONPCR   	  (*((volatile unsigned int *) 0x80004154))
#define DAIPCR0   	  (*((volatile unsigned int *) 0x80004158))
#define X2		   	  (*((volatile unsigned int *) 0x8000415C))
#define DAOPCR0   	  (*((volatile unsigned int *) 0x80004160))
#define DSSPCR1   	  (*((volatile unsigned int *) 0x80004164))
#define SAI1PCR   	  (*((volatile unsigned int *) 0x80004168))
#define X3 		   	  (*((volatile unsigned int *) 0x8000416C))
#define X4 		   	  (*((volatile unsigned int *) 0x80004170))
#define SAI4PCR	   	  (*((volatile unsigned int *) 0x80004174))
#define SAO1PCR	   	  (*((volatile unsigned int *) 0x80004178))
#define SAO2PCR	   	  (*((volatile unsigned int *) 0x8000417C))
#define X5 		   	  (*((volatile unsigned int *) 0x80004180))
#define DDACPCR0   	  (*((volatile unsigned int *) 0x80004184))
#define EDGEPCR	   	  (*((volatile unsigned int *) 0x80004188))
#define DADCPCR0   	  (*((volatile unsigned int *) 0x8000418C))
#define DCDCPCR	   	  (*((volatile unsigned int *) 0x80004190))
#define RTCPCR1	   	  (*((volatile unsigned int *) 0x80004194))
#define MCIPCR2	   	  (*((volatile unsigned int *) 0x80004198))
#define UARTPCR1   	  (*((volatile unsigned int *) 0x8000419C))
#define DDACPCR1   	  (*((volatile unsigned int *) 0x800041A0))
#define DDACPCR2   	  (*((volatile unsigned int *) 0x800041A4))
#define DADCPCR1   	  (*((volatile unsigned int *) 0x800041A8))
#define DADCPCR2   	  (*((volatile unsigned int *) 0x800041AC))
#define DAIPCR1   	  (*((volatile unsigned int *) 0x800041B0))
#define DAIPCR2   	  (*((volatile unsigned int *) 0x800041B4))
#define DAOPCR1   	  (*((volatile unsigned int *) 0x800041B8))
#define DAOPCR2   	  (*((volatile unsigned int *) 0x800041BC))
#define DAOPCR3   	  (*((volatile unsigned int *) 0x800041C0))
#define DAIPCR3   	  (*((volatile unsigned int *) 0x800041C4))
#define X6		   	  (*((volatile unsigned int *) 0x800041C8))

/* Power Status */
#define APB0PSR0   	  (*((volatile unsigned int *) 0x800041CC))
#define APB1PSR0   	  (*((volatile unsigned int *) 0x800041D0))
#define APB2PSR0   	  (*((volatile unsigned int *) 0x800041D4))
#define APB3PSR0   	  (*((volatile unsigned int *) 0x800041D8))
#define MMIOPSR0   	  (*((volatile unsigned int *) 0x800041DC))
#define AHB0PSR   	  (*((volatile unsigned int *) 0x800041E0))
#define MCIPSR0   	  (*((volatile unsigned int *) 0x800041E4))
#define MCIPSR1   	  (*((volatile unsigned int *) 0x800041E8))
#define UARTPSR0   	  (*((volatile unsigned int *) 0x800041EC))
#define DSSPSR0   	  (*((volatile unsigned int *) 0x800041F0))
#define X7		   	  (*((volatile unsigned int *) 0x800041F4))
#define FLSHPSR0   	  (*((volatile unsigned int *) 0x800041F8))
#define FLSHPSR1   	  (*((volatile unsigned int *) 0x800041FC))
#define FLSHPSR2   	  (*((volatile unsigned int *) 0x80004200))
#define LCDPSR0   	  (*((volatile unsigned int *) 0x80004204))
#define LCDPSR1   	  (*((volatile unsigned int *) 0x80004208))
#define DMAPSR0   	  (*((volatile unsigned int *) 0x8000420C))
#define DMAPSR1   	  (*((volatile unsigned int *) 0x80004210))
#define USBPSR0   	  (*((volatile unsigned int *) 0x80004214))
#define CPUPSR0   	  (*((volatile unsigned int *) 0x80004218))
#define CPUPSR1   	  (*((volatile unsigned int *) 0x8000421C))
#define CPUPSR2   	  (*((volatile unsigned int *) 0x80004220))
#define RAMPSR   	  (*((volatile unsigned int *) 0x80004224))
#define ROMPSR   	  (*((volatile unsigned int *) 0x80004228))
#define EMCPSR0   	  (*((volatile unsigned int *) 0x8000422C))
#define EMCPSR1   	  (*((volatile unsigned int *) 0x80004230))
#define MMIOPSR1   	  (*((volatile unsigned int *) 0x80004234))
#define APB0PSR1   	  (*((volatile unsigned int *) 0x80004238))
#define EVRTPSR   	  (*((volatile unsigned int *) 0x8000423C))
#define RTCPSR0   	  (*((volatile unsigned int *) 0x80004240))
#define ADCPSR0   	  (*((volatile unsigned int *) 0x80004244))
#define ADCPSR1   	  (*((volatile unsigned int *) 0x80004248))
#define WDTPSR   	  (*((volatile unsigned int *) 0x8000424C))
#define IOCPSR   	  (*((volatile unsigned int *) 0x80004250))
#define CGUPSR   	  (*((volatile unsigned int *) 0x80004254))
#define SYSCPSR   	  (*((volatile unsigned int *) 0x80004258))
#define APB1PSR1   	  (*((volatile unsigned int *) 0x8000425C))
#define T0PSR   	  (*((volatile unsigned int *) 0x80004260))
#define T1PSR   	  (*((volatile unsigned int *) 0x80004264))
#define I2CPSR   	  (*((volatile unsigned int *) 0x80004268))
#define APB3PSR1   	  (*((volatile unsigned int *) 0x8000426C))
#define SCONPSR   	  (*((volatile unsigned int *) 0x80004270))
#define DAIPSR0   	  (*((volatile unsigned int *) 0x80004274))
#define X8		   	  (*((volatile unsigned int *) 0x80004278))
#define DAOPSR0   	  (*((volatile unsigned int *) 0x8000427C))
#define DSSPSR1   	  (*((volatile unsigned int *) 0x80004280))
#define SAI1PSR   	  (*((volatile unsigned int *) 0x80004284))
#define X9 		   	  (*((volatile unsigned int *) 0x80004288))
#define X10		   	  (*((volatile unsigned int *) 0x8000428C))
#define SAI4PSR	   	  (*((volatile unsigned int *) 0x80004290))
#define SAO1PSR	   	  (*((volatile unsigned int *) 0x80004294))
#define SAO2PSR	   	  (*((volatile unsigned int *) 0x80004298))
#define X11		   	  (*((volatile unsigned int *) 0x8000429C))
#define DDACPSR0   	  (*((volatile unsigned int *) 0x800042A0))
#define EDGEPSR	   	  (*((volatile unsigned int *) 0x800042A4))
#define DADCPSR0   	  (*((volatile unsigned int *) 0x800042A8))
#define DADCPSR	   	  (*((volatile unsigned int *) 0x800042AC))
#define RTCPSR1	   	  (*((volatile unsigned int *) 0x800042B0))
#define MCIPSR2	   	  (*((volatile unsigned int *) 0x800042B4))
#define UARTPSR1   	  (*((volatile unsigned int *) 0x800042B8))
#define DDACPSR1   	  (*((volatile unsigned int *) 0x800042BC))
#define DDACPSR2   	  (*((volatile unsigned int *) 0x800042C0))
#define DADCPSR1   	  (*((volatile unsigned int *) 0x800042C4))
#define DADCPSR2   	  (*((volatile unsigned int *) 0x800042C8))
#define DAIPSR1   	  (*((volatile unsigned int *) 0x800042CC))
#define DAIPSR2   	  (*((volatile unsigned int *) 0x800042D0))
#define DAOPSR1   	  (*((volatile unsigned int *) 0x800042D4))
#define DAOPSR2   	  (*((volatile unsigned int *) 0x800042D8))
#define DAOPSR3   	  (*((volatile unsigned int *) 0x800042DC))
#define DAIPSR3   	  (*((volatile unsigned int *) 0x800042E0))
#define X12		   	  (*((volatile unsigned int *) 0x800042E4))

/* Enable Select  */
#define APB0ESR0   	  (*((volatile unsigned int *) 0x800042E8))
#define APB1ESR0   	  (*((volatile unsigned int *) 0x800042EC))
#define APB2ESR0   	  (*((volatile unsigned int *) 0x800042F0))
#define APB3ESR0   	  (*((volatile unsigned int *) 0x800042F4))
#define MMIOESR0   	  (*((volatile unsigned int *) 0x800042F8))
#define AHB0ESR   	  (*((volatile unsigned int *) 0x800042FC))
#define MCIESR0   	  (*((volatile unsigned int *) 0x80004300))
#define MCIESR1   	  (*((volatile unsigned int *) 0x80004304))
#define UARTESR0   	  (*((volatile unsigned int *) 0x80004308))
#define DSSESR0   	  (*((volatile unsigned int *) 0x8000430C))
#define X13		   	  (*((volatile unsigned int *) 0x80004310))
#define FLSHESR0   	  (*((volatile unsigned int *) 0x80004314))
#define FLSHESR1   	  (*((volatile unsigned int *) 0x80004318))
#define FLSHESR2   	  (*((volatile unsigned int *) 0x8000431C))
#define LCDESR0   	  (*((volatile unsigned int *) 0x80004320))
#define LCDESR1   	  (*((volatile unsigned int *) 0x80004324))
#define DMAESR0   	  (*((volatile unsigned int *) 0x80004328))
#define DMAESR1   	  (*((volatile unsigned int *) 0x8000432C))
#define USBESR0   	  (*((volatile unsigned int *) 0x80004330))
#define CPUESR0   	  (*((volatile unsigned int *) 0x80004334))
#define CPUESR1   	  (*((volatile unsigned int *) 0x80004338))
#define CPUESR2   	  (*((volatile unsigned int *) 0x8000433C))
#define RAMESR   	  (*((volatile unsigned int *) 0x80004340))
#define ROMESR   	  (*((volatile unsigned int *) 0x80004344))
#define EMCESR0   	  (*((volatile unsigned int *) 0x80004348))
#define EMCESR1   	  (*((volatile unsigned int *) 0x8000434C))
#define MMIOESR1   	  (*((volatile unsigned int *) 0x80004350))
#define APB0ESR1   	  (*((volatile unsigned int *) 0x80004354))
#define EVRTESR   	  (*((volatile unsigned int *) 0x80004358))
#define RTCESR   	  (*((volatile unsigned int *) 0x8000435C))
#define ADCESR0   	  (*((volatile unsigned int *) 0x80004360))
#define ADCESR1   	  (*((volatile unsigned int *) 0x80004364))
#define WDTESR   	  (*((volatile unsigned int *) 0x80004368))
#define IOCESR   	  (*((volatile unsigned int *) 0x8000436C))
#define CGUESR   	  (*((volatile unsigned int *) 0x80004370))
#define SYSCESR   	  (*((volatile unsigned int *) 0x80004374))
#define APB1ESR1   	  (*((volatile unsigned int *) 0x80004378))
#define T0ESR   	  (*((volatile unsigned int *) 0x8000437C))
#define T1ESR   	  (*((volatile unsigned int *) 0x80004380))
#define I2CESR   	  (*((volatile unsigned int *) 0x80004384))
#define APB3ESR1   	  (*((volatile unsigned int *) 0x80004388))
#define SCONESR   	  (*((volatile unsigned int *) 0x8000438C))
#define DAIESR0   	  (*((volatile unsigned int *) 0x80004390))
#define X14		   	  (*((volatile unsigned int *) 0x80004394))
#define DAOESR0   	  (*((volatile unsigned int *) 0x80004398))
#define DSSESR1   	  (*((volatile unsigned int *) 0x8000439C))
#define SAI1ESR   	  (*((volatile unsigned int *) 0x800043A0))
#define X15		   	  (*((volatile unsigned int *) 0x800043A4))
#define X16		   	  (*((volatile unsigned int *) 0x800043A8))
#define SAI4ESR	   	  (*((volatile unsigned int *) 0x800043AC))
#define SAO1ESR	   	  (*((volatile unsigned int *) 0x800043B0))
#define SAO2ESR	   	  (*((volatile unsigned int *) 0x800043B4))
#define X17		   	  (*((volatile unsigned int *) 0x800043B8))
#define DDACESR0   	  (*((volatile unsigned int *) 0x800043BC))
#define EDGEESR	   	  (*((volatile unsigned int *) 0x800043C0))
#define DADCESR0   	  (*((volatile unsigned int *) 0x800043C4))
#define UARTESR1   	  (*((volatile unsigned int *) 0x800043C8))
#define DDACESR1   	  (*((volatile unsigned int *) 0x800043CC))
#define DDACESR2   	  (*((volatile unsigned int *) 0x800043D0))
#define DADCESR1   	  (*((volatile unsigned int *) 0x800043D4))
#define DADCESR2   	  (*((volatile unsigned int *) 0x800043D8))
#define DAIESR1   	  (*((volatile unsigned int *) 0x800043DC))
#define DAIESR2   	  (*((volatile unsigned int *) 0x800043E0))
#define DAOESR1   	  (*((volatile unsigned int *) 0x800043E4))
#define DAOESR2   	  (*((volatile unsigned int *) 0x800043E8))
#define DAOESR3   	  (*((volatile unsigned int *) 0x800043EC))

/* Software Reset  */
#define APB0RES   	  (*((volatile unsigned int *) 0x80004C18))
#define APB0RES2   	  (*((volatile unsigned int *) 0x80004C1C))
#define APB1RES   	  (*((volatile unsigned int *) 0x80004C20))
#define APB1RES2   	  (*((volatile unsigned int *) 0x80004C24))
#define APB2RES   	  (*((volatile unsigned int *) 0x80004C28))
#define APB3RES   	  (*((volatile unsigned int *) 0x80004C2C))
#define APB3RES2  	  (*((volatile unsigned int *) 0x80004C30))
#define MMIORES   	  (*((volatile unsigned int *) 0x80004C34))
#define AHB0RES  	  (*((volatile unsigned int *) 0x80004C38))
#define T0RES   	  (*((volatile unsigned int *) 0x80004C3C))
#define T1RES   	  (*((volatile unsigned int *) 0x80004C40))
#define MCIRES   	  (*((volatile unsigned int *) 0x80004C44))
#define MCIRES2  	  (*((volatile unsigned int *) 0x80004C48))
#define UARTRES   	  (*((volatile unsigned int *) 0x80004C4C))
#define I2CRES   	  (*((volatile unsigned int *) 0x80004C50))
#define SCONRES   	  (*((volatile unsigned int *) 0x80004C58))
#define DAIRES   	  (*((volatile unsigned int *) 0x80004C60))
#define DAORES   	  (*((volatile unsigned int *) 0x80004C68))
#define DADCRES   	  (*((volatile unsigned int *) 0x80004C6C))
#define EDGERES   	  (*((volatile unsigned int *) 0x80004C70))
#define DDACRES   	  (*((volatile unsigned int *) 0x80004C74))
#define SAI1RES   	  (*((volatile unsigned int *) 0x80004C78))
#define SAI4RES   	  (*((volatile unsigned int *) 0x80004C84))
#define SAO1RES   	  (*((volatile unsigned int *) 0x80004C88))
#define SAO2RES   	  (*((volatile unsigned int *) 0x80004C8C))
#define FLSHRES   	  (*((volatile unsigned int *) 0x80004C94))
#define LCDRES   	  (*((volatile unsigned int *) 0x80004C98))
#define DMARES   	  (*((volatile unsigned int *) 0x80004C9C))
#define USBRES   	  (*((volatile unsigned int *) 0x80004CA0))
#define EMCRES   	  (*((volatile unsigned int *) 0x80004CA4))
#define MMIORES2   	  (*((volatile unsigned int *) 0x80004CA8))
/* -------------------------------------- */

/* External Memory Controller (EMC) */
#define EMC_MISC       (*(volatile unsigned long *)0x80005064)
#define EMC_BASE_ADDR		0x80008000
#define EMC_CTRL       (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x000))
#define EMC_STAT       (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x004))
#define EMC_CONFIG     (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x008))

/* Dynamic RAM access registers */
#define EMC_DYN_CTRL     (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x020))
#define EMC_DYN_RFSH     (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x024))
#define EMC_DYN_RD_CFG   (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x028))
#define EMC_DYN_RP       (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x030))
#define EMC_DYN_RAS      (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x034))
#define EMC_DYN_SREX     (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x038))
#define EMC_DYN_APR      (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x03C))
#define EMC_DYN_DAL      (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x040))
#define EMC_DYN_WR       (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x044))
#define EMC_DYN_RC       (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x048))
#define EMC_DYN_RFC      (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x04C))
#define EMC_DYN_XSR      (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x050))
#define EMC_DYN_RRD      (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x054))
#define EMC_DYN_MRD      (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x058))

#define EMC_DYN_CFG0     (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x100))
#define EMC_DYN_RASCAS0  (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x104))

/* static RAM access registers */
#define EMC_STA_CFG0      (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x200))
#define EMC_STA_WAITWEN0  (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x204))
#define EMC_STA_WAITOEN0  (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x208))
#define EMC_STA_WAITRD0   (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x20C))
#define EMC_STA_WAITPAGE0 (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x210))
#define EMC_STA_WAITWR0   (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x214))
#define EMC_STA_WAITTURN0 (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x218))

#define EMC_STA_CFG1      (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x220))
#define EMC_STA_WAITWEN1  (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x224))
#define EMC_STA_WAITOEN1  (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x228))
#define EMC_STA_WAITRD1   (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x22C))
#define EMC_STA_WAITPAGE1 (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x230))
#define EMC_STA_WAITWR1   (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x234))
#define EMC_STA_WAITTURN1 (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x238))

#define EMC_STA_CFG2      (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x240))
#define EMC_STA_WAITWEN2  (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x244))
#define EMC_STA_WAITOEN2  (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x248))
#define EMC_STA_WAITRD2   (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x24C))
#define EMC_STA_WAITPAGE2 (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x250))
#define EMC_STA_WAITWR2   (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x254))
#define EMC_STA_WAITTURN2 (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x258))

/* Interrupt Controller */
#define INT_PRIOMASK0 	(*((volatile unsigned int *) 0x80300000))
#define INT_PRIOMASK1   (*((volatile unsigned int *) 0x80300004))
#define INT_VECTOR0     (*((volatile unsigned int *) 0x80300100))
#define INT_VECTOR1     (*((volatile unsigned int *) 0x80300104))
#define INT_PENDING     (*((volatile unsigned int *) 0x80300200))
#define INT_FEATURES    (*((volatile unsigned int *) 0x80300300))
#define INT_REQ1 	    (*((volatile unsigned int *) 0x80300404))
#define INT_REQ2        (*((volatile unsigned int *) 0x80300408))
#define INT_REQ3        (*((volatile unsigned int *) 0x8030040C))
#define INT_REQ4        (*((volatile unsigned int *) 0x80300410))
#define INT_REQ5        (*((volatile unsigned int *) 0x80300414))
#define INT_REQ6        (*((volatile unsigned int *) 0x80300418))
#define INT_REQ7        (*((volatile unsigned int *) 0x8030041C))
#define INT_REQ8        (*((volatile unsigned int *) 0x80300420))
#define INT_REQ9        (*((volatile unsigned int *) 0x80300424))
#define INT_REQ10       (*((volatile unsigned int *) 0x80300428))
#define INT_REQ11       (*((volatile unsigned int *) 0x8030042C))
#define INT_REQ12       (*((volatile unsigned int *) 0x80300430))
#define INT_REQ13       (*((volatile unsigned int *) 0x80300434))
#define INT_REQ14       (*((volatile unsigned int *) 0x80300438))
#define INT_REQ15       (*((volatile unsigned int *) 0x8030043C))
#define INT_REQ16       (*((volatile unsigned int *) 0x80300440))
#define INT_REQ17       (*((volatile unsigned int *) 0x80300444))
#define INT_REQ18       (*((volatile unsigned int *) 0x80300448))
#define INT_REQ19       (*((volatile unsigned int *) 0x8030044C))
#define INT_REQ20       (*((volatile unsigned int *) 0x80300450))
#define INT_REQ21       (*((volatile unsigned int *) 0x80300454))
#define INT_REQ22       (*((volatile unsigned int *) 0x80300458))
#define INT_REQ23       (*((volatile unsigned int *) 0x8030045C))
#define INT_REQ24       (*((volatile unsigned int *) 0x80300460))
#define INT_REQ25       (*((volatile unsigned int *) 0x80300464))
#define INT_REQ26       (*((volatile unsigned int *) 0x80300468))
#define INT_REQ27       (*((volatile unsigned int *) 0x8030046C))
#define INT_REQ28       (*((volatile unsigned int *) 0x80300470))
#define INT_REQ29       (*((volatile unsigned int *) 0x80300474))

/* ------- Event Router ------- */

/* Input Group 0 Registers */
#define EVAPR0     (*((volatile unsigned int *) 0x80000CC0))
#define EVATR0     (*((volatile unsigned int *) 0x80000CE0))
#define EVECLR0    (*((volatile unsigned int *) 0x80000C20))
#define EVESET0    (*((volatile unsigned int *) 0x80000C40))
#define EVRSR0     (*((volatile unsigned int *) 0x80000D20))
#define EVMASK0    (*((volatile unsigned int *) 0x80000C60))
#define EVMCLR0    (*((volatile unsigned int *) 0x80000C80))
#define EVMSET0    (*((volatile unsigned int *) 0x80000CA0))
#define EVPEND0    (*((volatile unsigned int *) 0x80000C00))

#define EVIOMK00   (*((volatile unsigned int *) 0x80001400))
#define EVIOMK10   (*((volatile unsigned int *) 0x80001420))
#define EVIOMK20   (*((volatile unsigned int *) 0x80001440))
#define EVIOMK30   (*((volatile unsigned int *) 0x80001460))
#define EVIOMK40   (*((volatile unsigned int *) 0x80001480))

#define EVIOMC00   (*((volatile unsigned int *) 0x80001800))
#define EVIOMC10   (*((volatile unsigned int *) 0x80001820))
#define EVIOMC20   (*((volatile unsigned int *) 0x80001840))
#define EVIOMC30   (*((volatile unsigned int *) 0x80001860))
#define EVIOMC40   (*((volatile unsigned int *) 0x80001880))

#define EVIOMS00   (*((volatile unsigned int *) 0x80001C00))
#define EVIOMS10   (*((volatile unsigned int *) 0x80001C20))
#define EVIOMS20   (*((volatile unsigned int *) 0x80001C40))
#define EVIOMS30   (*((volatile unsigned int *) 0x80001C60))
#define EVIOMS40   (*((volatile unsigned int *) 0x80001C80))

#define EVIOP00    (*((volatile unsigned int *) 0x80001000))
#define EVIOP10    (*((volatile unsigned int *) 0x80001020))
#define EVIOP20    (*((volatile unsigned int *) 0x80001040))
#define EVIOP30    (*((volatile unsigned int *) 0x80001060))
#define EVIOP40    (*((volatile unsigned int *) 0x80001080))

/* Input Group 1 Registers */
#define EVAPR1     (*((volatile unsigned int *) 0x80000CC4))
#define EVATR1     (*((volatile unsigned int *) 0x80000CE4))
#define EVECLR1    (*((volatile unsigned int *) 0x80000C24))
#define EVESET1    (*((volatile unsigned int *) 0x80000C44))
#define EVRSR1     (*((volatile unsigned int *) 0x80000D24))
#define EVMASK1    (*((volatile unsigned int *) 0x80000C64))
#define EVMCLR1    (*((volatile unsigned int *) 0x80000C84))
#define EVMSET1    (*((volatile unsigned int *) 0x80000CA4))
#define EVPEND1    (*((volatile unsigned int *) 0x80000C04))

#define EVIOMK01   (*((volatile unsigned int *) 0x80001404))
#define EVIOMK11   (*((volatile unsigned int *) 0x80001424))
#define EVIOMK21   (*((volatile unsigned int *) 0x80001444))
#define EVIOMK31   (*((volatile unsigned int *) 0x80001464))
#define EVIOMK41   (*((volatile unsigned int *) 0x80001484))

#define EVIOMC01   (*((volatile unsigned int *) 0x80001804))
#define EVIOMC11   (*((volatile unsigned int *) 0x80001824))
#define EVIOMC21   (*((volatile unsigned int *) 0x80001844))
#define EVIOMC31   (*((volatile unsigned int *) 0x80001864))
#define EVIOMC41   (*((volatile unsigned int *) 0x80001884))

#define EVIOMS01   (*((volatile unsigned int *) 0x80001C04))
#define EVIOMS11   (*((volatile unsigned int *) 0x80001C24))
#define EVIOMS21   (*((volatile unsigned int *) 0x80001C44))
#define EVIOMS31   (*((volatile unsigned int *) 0x80001C64))
#define EVIOMS41   (*((volatile unsigned int *) 0x80001C84))

#define EVIOP01    (*((volatile unsigned int *) 0x80001004))
#define EVIOP11    (*((volatile unsigned int *) 0x80001024))
#define EVIOP21    (*((volatile unsigned int *) 0x80001044))
#define EVIOP31    (*((volatile unsigned int *) 0x80001064))
#define EVIOP41    (*((volatile unsigned int *) 0x80001084))

/* Input Group 2 Registers */
#define EVAPR2     (*((volatile unsigned int *) 0x80000CC8))
#define EVATR2     (*((volatile unsigned int *) 0x80000CE8))
#define EVECLR2    (*((volatile unsigned int *) 0x80000C28))
#define EVESET2    (*((volatile unsigned int *) 0x80000C48))
#define EVRSR2     (*((volatile unsigned int *) 0x80000D28))
#define EVMASK2    (*((volatile unsigned int *) 0x80000C68))
#define EVMCLR2    (*((volatile unsigned int *) 0x80000C88))
#define EVMSET2    (*((volatile unsigned int *) 0x80000CA8))
#define EVPEND2    (*((volatile unsigned int *) 0x80000C08))

#define EVIOMK02   (*((volatile unsigned int *) 0x80001408))
#define EVIOMK12   (*((volatile unsigned int *) 0x80001428))
#define EVIOMK22   (*((volatile unsigned int *) 0x80001448))
#define EVIOMK32   (*((volatile unsigned int *) 0x80001468))
#define EVIOMK42   (*((volatile unsigned int *) 0x80001488))

#define EVIOMC02   (*((volatile unsigned int *) 0x80001808))
#define EVIOMC12   (*((volatile unsigned int *) 0x80001828))
#define EVIOMC22   (*((volatile unsigned int *) 0x80001848))
#define EVIOMC32   (*((volatile unsigned int *) 0x80001868))
#define EVIOMC42   (*((volatile unsigned int *) 0x80001888))

#define EVIOMS02   (*((volatile unsigned int *) 0x80001C08))
#define EVIOMS12   (*((volatile unsigned int *) 0x80001C28))
#define EVIOMS22   (*((volatile unsigned int *) 0x80001C48))
#define EVIOMS32   (*((volatile unsigned int *) 0x80001C68))
#define EVIOMS42   (*((volatile unsigned int *) 0x80001C88))

#define EVIOP02    (*((volatile unsigned int *) 0x80001008))
#define EVIOP12    (*((volatile unsigned int *) 0x80001028))
#define EVIOP22    (*((volatile unsigned int *) 0x80001048))
#define EVIOP32    (*((volatile unsigned int *) 0x80001068))
#define EVIOP42    (*((volatile unsigned int *) 0x80001088))

/* Input Group 3 Registers */
#define EVAPR3     (*((volatile unsigned int *) 0x80000CCC))
#define EVATR3     (*((volatile unsigned int *) 0x80000CEC))
#define EVECLR3    (*((volatile unsigned int *) 0x80000C2C))
#define EVESET3    (*((volatile unsigned int *) 0x80000C4C))
#define EVRSR3     (*((volatile unsigned int *) 0x80000D2C))
#define EVMASK3    (*((volatile unsigned int *) 0x80000C6C))
#define EVMCLR3    (*((volatile unsigned int *) 0x80000C8C))
#define EVMSET3    (*((volatile unsigned int *) 0x80000CAC))
#define EVPEND3    (*((volatile unsigned int *) 0x80000C0C))

#define EVIOMK03   (*((volatile unsigned int *) 0x8000140C))
#define EVIOMK13   (*((volatile unsigned int *) 0x8000142C))
#define EVIOMK23   (*((volatile unsigned int *) 0x8000144C))
#define EVIOMK33   (*((volatile unsigned int *) 0x8000146C))
#define EVIOMK43   (*((volatile unsigned int *) 0x8000148C))

#define EVIOMC03   (*((volatile unsigned int *) 0x8000180C))
#define EVIOMC13   (*((volatile unsigned int *) 0x8000182C))
#define EVIOMC23   (*((volatile unsigned int *) 0x8000184C))
#define EVIOMC33   (*((volatile unsigned int *) 0x8000186C))
#define EVIOMC43   (*((volatile unsigned int *) 0x8000188C))

#define EVIOMS03   (*((volatile unsigned int *) 0x80001C0C))
#define EVIOMS13   (*((volatile unsigned int *) 0x80001C2C))
#define EVIOMS23   (*((volatile unsigned int *) 0x80001C4C))
#define EVIOMS33   (*((volatile unsigned int *) 0x80001C6C))
#define EVIOMS43   (*((volatile unsigned int *) 0x80001C8C))

#define EVIOP03    (*((volatile unsigned int *) 0x8000100C))
#define EVIOP13    (*((volatile unsigned int *) 0x8000102C))
#define EVIOP23    (*((volatile unsigned int *) 0x8000104C))
#define EVIOP33    (*((volatile unsigned int *) 0x8000106C))
#define EVIOP43    (*((volatile unsigned int *) 0x8000108C))
/* -------------------------- */

/* Timer0 */
#define T0LOAD 	  (*((volatile unsigned int *) 0x80020000))
#define T0VALUE   (*((volatile unsigned int *) 0x80020004))
#define T0CTRL    (*((volatile unsigned int *) 0x80020008))
#define T0CLR     (*((volatile unsigned int *) 0x8002000C))

/* Timer1 */
#define T1LOAD 	  (*((volatile unsigned int *) 0x80020400))
#define T1VALUE   (*((volatile unsigned int *) 0x80020404))
#define T1CTRL    (*((volatile unsigned int *) 0x80020408))
#define T1CLR     (*((volatile unsigned int *) 0x8002040C))

/* Watchdog Timer */
#define WDT_SR    (*((volatile unsigned int *) 0x80002800))
#define WDT_TCR   (*((volatile unsigned int *) 0x80002804))
#define WDT_TC    (*((volatile unsigned int *) 0x80002808))
#define WDT_PR    (*((volatile unsigned int *) 0x8000280C))
#define WDT_MCR   (*((volatile unsigned int *) 0x80002814))
#define WDT_MR0   (*((volatile unsigned int *) 0x80002818))
#define WDT_MR1   (*((volatile unsigned int *) 0x8000281C))
#define WDT_EMR   (*((volatile unsigned int *) 0x8000283C))

/* Real Time Clock */
#define RTC_BASE_ADDR		0x80002000
#define RTC_CFG         (*((volatile unsigned int *) 0x80005024))
#define RTC_ILR         (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x00))
#define RTC_CTC         (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x04))
#define RTC_CCR         (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x08))
#define RTC_CIIR        (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x0C))
#define RTC_AMR         (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x10))
#define RTC_CTIME0      (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x14))
#define RTC_CTIME1      (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x18))
#define RTC_CTIME2      (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x1C))
#define RTC_SEC         (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x20))
#define RTC_MIN         (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x24))
#define RTC_HOUR        (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x28))
#define RTC_DOM         (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x2C))
#define RTC_DOW         (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x30))
#define RTC_DOY         (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x34))
#define RTC_MONTH       (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x38))
#define RTC_YEAR        (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x3C))
#define RTC_CISS        (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x40))
#define RTC_ALSEC       (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x60))
#define RTC_ALMIN       (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x64))
#define RTC_ALHOUR      (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x68))
#define RTC_ALDOM       (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x6C))
#define RTC_ALDOW       (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x70))
#define RTC_ALDOY       (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x74))
#define RTC_ALMON       (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x78))
#define RTC_ALYEAR      (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x7C))

/* UART */
#define UART_RBR   (*((volatile unsigned int *) 0x80101000))
#define UART_THR   (*((volatile unsigned int *) 0x80101000))
#define UART_DLL   (*((volatile unsigned int *) 0x80101000))
#define UART_IER   (*((volatile unsigned int *) 0x80101004))
#define UART_DLM   (*((volatile unsigned int *) 0x80101004))
#define UART_IIR   (*((volatile unsigned int *) 0x80101008))
#define UART_FCR   (*((volatile unsigned int *) 0x80101008))
#define UART_LCR   (*((volatile unsigned int *) 0x8010100c))
#define UART_MCR   (*((volatile unsigned int *) 0x80101010))
#define UART_LSR   (*((volatile unsigned int *) 0x80101014))
#define UART_MSR   (*((volatile unsigned int *) 0x80101018))
#define UART_SCR   (*((volatile unsigned int *) 0x8010101c))
#define UART_ACR   (*((volatile unsigned int *) 0x80101020))
#define UART_ICR   (*((volatile unsigned int *) 0x80101024))
#define UART_FDR   (*((volatile unsigned int *) 0x80101028))
#define UART_POP   (*((volatile unsigned int *) 0x80101030))
#define UART_MODE  (*((volatile unsigned int *) 0x80101034))
#define UART_CFG   (*((volatile unsigned int *) 0x80101FD4))
#define UART_INTCE (*((volatile unsigned int *) 0x80101FD8))
#define UART_INTSE (*((volatile unsigned int *) 0x80101FDC))
#define UART_INTS  (*((volatile unsigned int *) 0x80101FE0))
#define UART_INTE  (*((volatile unsigned int *) 0x80101FE4))
#define UART_INTCS (*((volatile unsigned int *) 0x80101FE8))
#define UART_INTSS (*((volatile unsigned int *) 0x80101FEC))

/* GPDMA  */
#define DMA0Source  	(*((volatile unsigned int *) 0x80103800))
#define DMA0Dest	  	(*((volatile unsigned int *) 0x80103804))
#define DMA0Length  	(*((volatile unsigned int *) 0x80103808))
#define DMA0Config	 	(*((volatile unsigned int *) 0x8010380C))
#define DMA0Enab	  	(*((volatile unsigned int *) 0x80103810))
#define DMA0Count	  	(*((volatile unsigned int *) 0x8010381C))

#define DMA1Source  	(*((volatile unsigned int *) 0x80103820))
#define DMA1Dest	  	(*((volatile unsigned int *) 0x80103824))
#define DMA1Length  	(*((volatile unsigned int *) 0x80103828))
#define DMA1Config	 	(*((volatile unsigned int *) 0x8010382C))
#define DMA1Enab	  	(*((volatile unsigned int *) 0x80103830))
#define DMA1Count	  	(*((volatile unsigned int *) 0x8010383C))

#define DMA2Source  	(*((volatile unsigned int *) 0x80103840))
#define DMA2Dest	  	(*((volatile unsigned int *) 0x80103844))
#define DMA2Length  	(*((volatile unsigned int *) 0x80103848))
#define DMA2Config	 	(*((volatile unsigned int *) 0x8010384C))
#define DMA2Enab	  	(*((volatile unsigned int *) 0x80103850))
#define DMA2Count	  	(*((volatile unsigned int *) 0x8010385C))

#define DMA3Source  	(*((volatile unsigned int *) 0x80103860))
#define DMA3Dest	  	(*((volatile unsigned int *) 0x80103864))
#define DMA3Length  	(*((volatile unsigned int *) 0x80103868))
#define DMA3Config	 	(*((volatile unsigned int *) 0x8010386C))
#define DMA3Enab	  	(*((volatile unsigned int *) 0x80103870))
#define DMA3Count	  	(*((volatile unsigned int *) 0x8010387C))

#define DMA4Source  	(*((volatile unsigned int *) 0x80103880))
#define DMA4Dest	  	(*((volatile unsigned int *) 0x80103884))
#define DMA4Length  	(*((volatile unsigned int *) 0x80103888))
#define DMA4Config	 	(*((volatile unsigned int *) 0x8010388C))
#define DMA4Enab	  	(*((volatile unsigned int *) 0x80103890))
#define DMA4Count	  	(*((volatile unsigned int *) 0x8010389C))

#define DMA5Source  	(*((volatile unsigned int *) 0x801038A0))
#define DMA5Dest	  	(*((volatile unsigned int *) 0x801038A4))
#define DMA5Length  	(*((volatile unsigned int *) 0x801038A8))
#define DMA5Config	 	(*((volatile unsigned int *) 0x801038AC))
#define DMA5Enab	  	(*((volatile unsigned int *) 0x801038B0))
#define DMA5Count	  	(*((volatile unsigned int *) 0x801038BC))

#define DMA6Source  	(*((volatile unsigned int *) 0x801038C0))
#define DMA6Dest	  	(*((volatile unsigned int *) 0x801038C4))
#define DMA6Length  	(*((volatile unsigned int *) 0x801038C8))
#define DMA6Config	 	(*((volatile unsigned int *) 0x801038CC))
#define DMA6Enab	  	(*((volatile unsigned int *) 0x801038D0))
#define DMA6Count	  	(*((volatile unsigned int *) 0x801038DC))

#define DMA7Source  	(*((volatile unsigned int *) 0x801038E0))
#define DMA7Dest	  	(*((volatile unsigned int *) 0x801038E4))
#define DMA7Length  	(*((volatile unsigned int *) 0x801038E8))
#define DMA7Config	 	(*((volatile unsigned int *) 0x801038EC))
#define DMA7Enab	  	(*((volatile unsigned int *) 0x801038F0))
#define DMA7Count	  	(*((volatile unsigned int *) 0x801038FC))

#define DMA0AltSource  		(*((volatile unsigned int *) 0x80103A00))
#define DMA0AltDest	  		(*((volatile unsigned int *) 0x80103A04))
#define DMA0AltLength  		(*((volatile unsigned int *) 0x80103A08))
#define DMA0AltConfig	 	(*((volatile unsigned int *) 0x80103A0C))

#define DMA1AltSource  		(*((volatile unsigned int *) 0x80103A10))
#define DMA1AltDest	  		(*((volatile unsigned int *) 0x80103A14))
#define DMA1AltLength  		(*((volatile unsigned int *) 0x80103A18))
#define DMA1AltConfig	 	(*((volatile unsigned int *) 0x80103A1C))

#define DMA2AltSource  		(*((volatile unsigned int *) 0x80103A20))
#define DMA2AltDest	  		(*((volatile unsigned int *) 0x80103A24))
#define DMA2AltLength  		(*((volatile unsigned int *) 0x80103A28))
#define DMA2AltConfig	 	(*((volatile unsigned int *) 0x80103A2C))

#define DMA3AltSource  		(*((volatile unsigned int *) 0x80103A30))
#define DMA3AltDest	  		(*((volatile unsigned int *) 0x80103A34))
#define DMA3AltLength  		(*((volatile unsigned int *) 0x80103A38))
#define DMA3AltConfig	 	(*((volatile unsigned int *) 0x80103A3C))

#define DMA4AltSource  		(*((volatile unsigned int *) 0x80103A40))
#define DMA4AltDest	  		(*((volatile unsigned int *) 0x80103A44))
#define DMA4AltLength  		(*((volatile unsigned int *) 0x80103A48))
#define DMA4AltConfig	 	(*((volatile unsigned int *) 0x80103A4C))

#define DMA5AltSource  		(*((volatile unsigned int *) 0x80103A50))
#define DMA5AltDest	  		(*((volatile unsigned int *) 0x80103A54))
#define DMA5AltLength  		(*((volatile unsigned int *) 0x80103A58))
#define DMA5AltConfig	 	(*((volatile unsigned int *) 0x80103A5C))

#define DMA6AltSource  		(*((volatile unsigned int *) 0x80103A60))
#define DMA6AltDest	  		(*((volatile unsigned int *) 0x80103A64))
#define DMA6AltLength  		(*((volatile unsigned int *) 0x80103A68))
#define DMA6AltConfig	 	(*((volatile unsigned int *) 0x80103A6C))

#define DMA7AltSource  		(*((volatile unsigned int *) 0x80103A70))
#define DMA7AltDest	  		(*((volatile unsigned int *) 0x80103A74))
#define DMA7AltLength  		(*((volatile unsigned int *) 0x80103A78))
#define DMA7AltConfig	 	(*((volatile unsigned int *) 0x80103A7C))

#define DMA_Enable	 	(*((volatile unsigned int *) 0x80103C00))
#define DMA_Stat	 	(*((volatile unsigned int *) 0x80103C04))
#define DMA_IRQMask	 	(*((volatile unsigned int *) 0x80103C08))
#define DMA_SoftInt 	(*((volatile unsigned int *) 0x80103C10))

#define DMA3EXTEN	(*((volatile unsigned int *) 0x80005040))
#define DMA5EXTEN	(*((volatile unsigned int *) 0x80005044))

/* I2C */
#define I2RX		(*((volatile unsigned int *) 0x80020800))
#define I2TX		(*((volatile unsigned int *) 0x80020800))
#define I2STS		(*((volatile unsigned int *) 0x80020804))
#define I2CTL		(*((volatile unsigned int *) 0x80020808))
#define I2CLKHI		(*((volatile unsigned int *) 0x8002080C))
#define I2CLKLO		(*((volatile unsigned int *) 0x80020810))
#define I2ADR		(*((volatile unsigned int *) 0x80020814))
#define I2RFL		(*((volatile unsigned int *) 0x80020818))
#define I2TFL		(*((volatile unsigned int *) 0x8002081C))
#define I2RXB		(*((volatile unsigned int *) 0x80020820))
#define I2TXB		(*((volatile unsigned int *) 0x80020824))
#define I2TXS		(*((volatile unsigned int *) 0x80020828))
#define I2STFL		(*((volatile unsigned int *) 0x8002082C))

/* ADC */
#define ADCR0		(*((volatile unsigned int *) 0x80002400))
#define ADCR1		(*((volatile unsigned int *) 0x80002404))
#define ADCR2		(*((volatile unsigned int *) 0x80002408))
#define ADCR3		(*((volatile unsigned int *) 0x8000240C))
#define ADCR4		(*((volatile unsigned int *) 0x80002410))
#define ADCR5		(*((volatile unsigned int *) 0x80002414))

#define ADCCON		(*((volatile unsigned int *) 0x80002420))
#define ADCSEL		(*((volatile unsigned int *) 0x80002424))
#define ADCINTE		(*((volatile unsigned int *) 0x80002428))
#define ADCINTS		(*((volatile unsigned int *) 0x8000242C))
#define ADCINTC		(*((volatile unsigned int *) 0x80002430))
#define ADCPD		(*((volatile unsigned int *) 0x80005028))

/* USB */
#define USBDevAdr		(*((volatile unsigned int *) 0x80041000))
#define USBEMaxSize		(*((volatile unsigned int *) 0x80041004))
#define USBEType		(*((volatile unsigned int *) 0x80041008))
#define USBMode			(*((volatile unsigned int *) 0x8004100C))
#define USBIntCfg		(*((volatile unsigned int *) 0x80041010))
#define USBDCnt			(*((volatile unsigned int *) 0x8004101c))
#define USBData			(*((volatile unsigned int *) 0x80041020))
#define USBShort		(*((volatile unsigned int *) 0x80041024))
#define USBECtrl		(*((volatile unsigned int *) 0x80041028))
#define USBEIX			(*((volatile unsigned int *) 0x8004102C))
#define USBFN			(*((volatile unsigned int *) 0x80041074))
#define USBScratch		(*((volatile unsigned int *) 0x80041078))
#define USBLock			(*((volatile unsigned int *) 0x8004107C))
#define USBTest			(*((volatile unsigned int *) 0x80041084))
#define USBIntE			(*((volatile unsigned int *) 0x8004108C))
#define USBEIntE		(*((volatile unsigned int *) 0x80041090))
#define USBIntStat		(*((volatile unsigned int *) 0x80041094))
#define USBEIntStat		(*((volatile unsigned int *) 0x80041098))
#define USBEIntClr		(*((volatile unsigned int *) 0x800410A0))
#define USBEIntSet		(*((volatile unsigned int *) 0x800410A4))
#define USBEIntP		(*((volatile unsigned int *) 0x800410A8))
#define USBIntClr		(*((volatile unsigned int *) 0x800410AC))
#define USBIntSet		(*((volatile unsigned int *) 0x800410B0))
#define USBIntP			(*((volatile unsigned int *) 0x800410B4))
#define USBClkEn		(*((volatile unsigned int *) 0x80005050))

#define UDMA0Stat		(*((volatile unsigned int *) 0x80040000))
#define UDMA0Ctrl		(*((volatile unsigned int *) 0x80040004))
#define UDMA0Src		(*((volatile unsigned int *) 0x80040008))
#define UDMA0Dest		(*((volatile unsigned int *) 0x8004000C))
#define UDMA0Throtl		(*((volatile unsigned int *) 0x80040010))
#define UDMA0Cnt		(*((volatile unsigned int *) 0x80040014))

#define UDMA1Stat		(*((volatile unsigned int *) 0x80040040))
#define UDMA1Ctrl		(*((volatile unsigned int *) 0x80040044))
#define UDMA1Src		(*((volatile unsigned int *) 0x80040048))
#define UDMA1Dest		(*((volatile unsigned int *) 0x8004004C))
#define UDMA1Throtl		(*((volatile unsigned int *) 0x80040050))
#define UDMA1Cnt		(*((volatile unsigned int *) 0x80040054))

#define UDMACtrl		(*((volatile unsigned int *) 0x80040400))
#define UDMASoftRes		(*((volatile unsigned int *) 0x80040404))
#define UDMAStat		(*((volatile unsigned int *) 0x80040408))
#define UDMAIntStat		(*((volatile unsigned int *) 0x80040410))
#define UDMAIntEn		(*((volatile unsigned int *) 0x80040418))
#define UDMAIntDis		(*((volatile unsigned int *) 0x80040420))
#define UDMAIntSet		(*((volatile unsigned int *) 0x80040428))
#define UDMAIntClr		(*((volatile unsigned int *) 0x80040430))
#define UDMAFCP0		(*((volatile unsigned int *) 0x80040500))
#define UDMAFCP1		(*((volatile unsigned int *) 0x80040504))
#define UDMAFCP2		(*((volatile unsigned int *) 0x80040508))
#define UDMAFCP3		(*((volatile unsigned int *) 0x8004050C))

/* I2S DAI/DAO */
#define SIOCR		(*((volatile unsigned int *) 0x80200384))
#define I2S_FMT		(*((volatile unsigned int *) 0x80200380))

/* I2S DAI-SAI1 */
#define L16IN1			(*((volatile unsigned int *) 0x80200000))
#define R16IN1			(*((volatile unsigned int *) 0x80200004))
#define L24IN1			(*((volatile unsigned int *) 0x80200008))
#define R24IN1			(*((volatile unsigned int *) 0x8020000C))
#define SAISTAT1		(*((volatile unsigned int *) 0x80200010))
#define SAIMASK1		(*((volatile unsigned int *) 0x80200014))
#define L32IN1			(*((volatile unsigned int *) 0x80200020))
#define R32IN1			(*((volatile unsigned int *) 0x80200040))
#define LR32IN1			(*((volatile unsigned int *) 0x80200060))

/* I2S DA0-SAO1 */
#define L16OUT1			(*((volatile unsigned int *) 0x80200200))
#define R16OUT1			(*((volatile unsigned int *) 0x80200204))
#define L24OUT1			(*((volatile unsigned int *) 0x80200208))
#define R24OUT1			(*((volatile unsigned int *) 0x8020020C))
#define SAOSTAT1		(*((volatile unsigned int *) 0x80200210))
#define SAOMASK1		(*((volatile unsigned int *) 0x80200214))
#define L32OUT1			(*((volatile unsigned int *) 0x80200220))
#define R32OUT1			(*((volatile unsigned int *) 0x80200240))
#define LR32OUT1		(*((volatile unsigned int *) 0x80200260))

/* Dual ADC */
#define DAINCTRL		(*((volatile unsigned int *) 0x802003A4))
#define DADCCTRL		(*((volatile unsigned int *) 0x802003A8))
#define DECCTRL			(*((volatile unsigned int *) 0x802003AC))
#define DECSTAT			(*((volatile unsigned int *) 0x802003B0))

/* Dual ADC-SAI4 */
#define L16IN4			(*((volatile unsigned int *) 0x80200180))
#define R16IN4			(*((volatile unsigned int *) 0x80200184))
#define L24IN4			(*((volatile unsigned int *) 0x80200188))
#define R24IN4			(*((volatile unsigned int *) 0x8020018C))
#define SAISTAT4		(*((volatile unsigned int *) 0x80200190))
#define SAIMASK4		(*((volatile unsigned int *) 0x80200194))
#define L32IN4			(*((volatile unsigned int *) 0x802001A0))
#define R32IN4			(*((volatile unsigned int *) 0x802001C0))
#define LR32IN4			(*((volatile unsigned int *) 0x802001E0))

/* Dual DAC*/
#define DDACCTRL		(*((volatile unsigned int *) 0x80200398))
#define DDACSTAT		(*((volatile unsigned int *) 0x8020039C))
#define DDACSET			(*((volatile unsigned int *) 0x802003A0))

/* Dual DAC-SAO2 */
#define L16OUT2			(*((volatile unsigned int *) 0x80200280))
#define R16OUT2			(*((volatile unsigned int *) 0x80200284))
#define L24OUT2			(*((volatile unsigned int *) 0x80200288))
#define R24OUT2			(*((volatile unsigned int *) 0x8020028C))
#define SAOSTAT2		(*((volatile unsigned int *) 0x80200290))
#define SAOMASK2		(*((volatile unsigned int *) 0x80200294))
#define L32OUT2			(*((volatile unsigned int *) 0x802002A0))
#define R32OUT2			(*((volatile unsigned int *) 0x802002C0))
#define LR32OUT2		(*((volatile unsigned int *) 0x802002E0))

/* SD/MCI */
/* MultiMedia Card Interface(MCI) Controller */
#define MCI_BASE_ADDR		0x80100000
#define MCI_POWER      (*(volatile unsigned long *)(MCI_BASE_ADDR + 0x00))
#define MCI_CLOCK      (*(volatile unsigned long *)(MCI_BASE_ADDR + 0x04))
#define MCI_ARGUMENT   (*(volatile unsigned long *)(MCI_BASE_ADDR + 0x08))
#define MCI_COMMAND    (*(volatile unsigned long *)(MCI_BASE_ADDR + 0x0C))
#define MCI_RESP_CMD   (*(volatile unsigned long *)(MCI_BASE_ADDR + 0x10))
#define MCI_RESP0      (*(volatile unsigned long *)(MCI_BASE_ADDR + 0x14))
#define MCI_RESP1      (*(volatile unsigned long *)(MCI_BASE_ADDR + 0x18))
#define MCI_RESP2      (*(volatile unsigned long *)(MCI_BASE_ADDR + 0x1C))
#define MCI_RESP3      (*(volatile unsigned long *)(MCI_BASE_ADDR + 0x20))
#define MCI_DATA_TMR   (*(volatile unsigned long *)(MCI_BASE_ADDR + 0x24))
#define MCI_DATA_LEN   (*(volatile unsigned long *)(MCI_BASE_ADDR + 0x28))
#define MCI_DATA_CTRL  (*(volatile unsigned long *)(MCI_BASE_ADDR + 0x2C))
#define MCI_DATA_CNT   (*(volatile unsigned long *)(MCI_BASE_ADDR + 0x30))
#define MCI_STATUS     (*(volatile unsigned long *)(MCI_BASE_ADDR + 0x34))
#define MCI_CLEAR      (*(volatile unsigned long *)(MCI_BASE_ADDR + 0x38))
#define MCI_MASK0      (*(volatile unsigned long *)(MCI_BASE_ADDR + 0x3C))
#define MCI_MASK1      (*(volatile unsigned long *)(MCI_BASE_ADDR + 0x40))
#define MCI_FIFO_CNT   (*(volatile unsigned long *)(MCI_BASE_ADDR + 0x48))
#define MCI_FIFO       (*(volatile unsigned long *)(MCI_BASE_ADDR + 0x80))
#define MCICLKEN		(*((volatile unsigned int *) 0x8000502C))

/* LCD */
#define LCDSTAT 		(*((volatile unsigned int *) 0x80103000))
#define LCDCTRL 		(*((volatile unsigned int *) 0x80103004))
#define LCDISTAT 		(*((volatile unsigned int *) 0x80103008))
#define LCDICLR 		(*((volatile unsigned int *) 0x8010300C))
#define LCDIMASK 		(*((volatile unsigned int *) 0x80103010))
#define LCDREAD 		(*((volatile unsigned int *) 0x80103014))
#define LCDIBYTE 		(*((volatile unsigned int *) 0x80103020))
#define LCDDBYTE 		(*((volatile unsigned int *) 0x80103030))
#define LCDIWORD 		(*((volatile unsigned int *) 0x80103040))
#define LCDDWORD 		(*((volatile unsigned int *) 0x80103080))

/* Port0 */
#define MODE1_0 	(*((volatile unsigned int *) 0x80003020))
#define MODE0_0 	(*((volatile unsigned int *) 0x80003010))
#define MODE1S_0 	(*((volatile unsigned int *) 0x80003024))
#define MODE0S_0 	(*((volatile unsigned int *) 0x80003014))
#define MODE1C_0 	(*((volatile unsigned int *) 0x80003028))
#define MODE0C_0 	(*((volatile unsigned int *) 0x80003018))
#define PINS_0	 	(*((volatile unsigned int *) 0x80003000))

/* Port1 */
#define MODE1_1 	(*((volatile unsigned int *) 0x80003060))
#define MODE0_1 	(*((volatile unsigned int *) 0x80003050))
#define MODE1S_1 	(*((volatile unsigned int *) 0x80003064))
#define MODE0S_1 	(*((volatile unsigned int *) 0x80003054))
#define MODE1C_1 	(*((volatile unsigned int *) 0x80003068))
#define MODE0C_1 	(*((volatile unsigned int *) 0x80003058))
#define PINS_1	 	(*((volatile unsigned int *) 0x80003040))

/* Port2 */
#define MODE1_2 	(*((volatile unsigned int *) 0x800030A0))
#define MODE0_2 	(*((volatile unsigned int *) 0x80003090))
#define MODE1S_2 	(*((volatile unsigned int *) 0x800030A4))
#define MODE0S_2 	(*((volatile unsigned int *) 0x80003094))
#define MODE1C_2 	(*((volatile unsigned int *) 0x800030A8))
#define MODE0C_2 	(*((volatile unsigned int *) 0x80003098))
#define PINS_2	 	(*((volatile unsigned int *) 0x80003080))

/* Port3 */
#define MODE1_3 	(*((volatile unsigned int *) 0x800030E0))
#define MODE0_3 	(*((volatile unsigned int *) 0x800030D0))
#define MODE1S_3 	(*((volatile unsigned int *) 0x800030E4))
#define MODE0S_3 	(*((volatile unsigned int *) 0x800030D4))
#define MODE1C_3 	(*((volatile unsigned int *) 0x800030E8))
#define MODE0C_3 	(*((volatile unsigned int *) 0x800030D8))
#define PINS_3	 	(*((volatile unsigned int *) 0x800030C0))

/* Port4 */
#define MODE1_4 	(*((volatile unsigned int *) 0x80003120))
#define MODE0_4 	(*((volatile unsigned int *) 0x80003110))
#define MODE1S_4 	(*((volatile unsigned int *) 0x80003124))
#define MODE0S_4 	(*((volatile unsigned int *) 0x80003114))
#define MODE1C_4 	(*((volatile unsigned int *) 0x80003128))
#define MODE0C_4 	(*((volatile unsigned int *) 0x80003118))
#define PINS_4	 	(*((volatile unsigned int *) 0x80003100))

/* Port5 */
#define MODE1_5 	(*((volatile unsigned int *) 0x80003160))
#define MODE0_5 	(*((volatile unsigned int *) 0x80003150))
#define MODE1S_5 	(*((volatile unsigned int *) 0x80003164))
#define MODE0S_5 	(*((volatile unsigned int *) 0x80003154))
#define MODE1C_5 	(*((volatile unsigned int *) 0x80003168))
#define MODE0C_5 	(*((volatile unsigned int *) 0x80003158))
#define PINS_5	 	(*((volatile unsigned int *) 0x80003140))

/* Port6 */
#define MODE1_6 	(*((volatile unsigned int *) 0x800031A0))
#define MODE0_6 	(*((volatile unsigned int *) 0x80003190))
#define MODE1S_6 	(*((volatile unsigned int *) 0x800031A4))
#define MODE0S_6 	(*((volatile unsigned int *) 0x80003194))
#define MODE1C_6 	(*((volatile unsigned int *) 0x800031A8))
#define MODE0C_6 	(*((volatile unsigned int *) 0x80003198))
#define PINS_6 		(*((volatile unsigned int *) 0x80003180))

/* Port7 */
#define MODE1_7 	(*((volatile unsigned int *) 0x800031E0))
#define MODE0_7 	(*((volatile unsigned int *) 0x800031D0))
#define MODE1S_7 	(*((volatile unsigned int *) 0x800031E4))
#define MODE0S_7 	(*((volatile unsigned int *) 0x800031D4))
#define MODE1C_7 	(*((volatile unsigned int *) 0x800031E8))
#define MODE0C_7 	(*((volatile unsigned int *) 0x800031D8))
#define PINS_7	 	(*((volatile unsigned int *) 0x800031C0))

#endif

